from django.shortcuts import render
from xtattend.staticsFunction import *
import logging
logger = logging.getLogger(__name__)


def attendance_view(request):
    # 全年按个人加班趋势
    user_total_dict = get_attend_with_user_by_all()

    # 全年按项目加班趋势
    project_total_dict = get_attend_with_project_by_all()
    # 全年各月份加班趋势
    month_total_dict = get_attend_every_by_month()
    # 全年各月份按项目加班趋势
    month_project_attend = get_attend_by_month_with_project()

    # 全年各月份按角色加班趋势
    role_attend = get_attend_by_role()

    # 全年各月份个人加班趋势
    month_user_attend = get_attend_by_month_with_user()

    return render(request, 'attendance/attendance.html', locals())

